home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / optimize3-setup-1002.exe / {app} / support / Remove-PCPitstop2.cmd < prev    next >
Encoding:
Text File  |  2009-02-18  |  4.2 KB  |  89 lines

  1. @echo off
  2. setlocal enableextensions
  3. ::
  4. :: Remove all traces of the PCPitstop2 ActiveX control and optionally install a new control
  5. :: Version 2.12 (07/20/2008)
  6. ::
  7. echo .
  8. echo . Ready to remove the PCPitstop2 ActiveX control. If there is a new
  9. echo . copy of PCPitstop2.dll on the desktop it will be installed.
  10. echo .
  11. echo . NOTE: On Windows Vista, this file must be run as Administrator.
  12. echo . (Right-click the file and select "Run as Administrator".)
  13. echo .
  14. echo . Close all copies of Internet Explorer or Optimize and press Enter.
  15. echo . To cancel, press Ctrl-C.
  16. echo .
  17. pause
  18.  
  19. :: Registry key abbreviation
  20. set LMCV=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion
  21. :: Full path to Downloaded Program Files
  22. set dpf=%systemroot%\Downloaded Program Files
  23. :: All DLLs bundled with PCPitstop2.dll at any point
  24. set dlls=PCPitstop2.dll
  25. :: CLSID and Typelib for PCPitstop2.Exam root object
  26. set cexam=FFB3A759-98B1-446F-BDA9-909C6EB18CC7
  27. set texam=D928BAFC-11CD-4230-96EB-D58BE7240CF1
  28. :: RegSvr32 command to unregister an ActiveX control silently
  29. set rs32="%systemroot%\system32\regsvr32.exe" /u /s
  30.  
  31. :: If there is a PCPitstop2.dll in this directory, copy it to the DPF location
  32. if not exist "%UserProfile%\Desktop\PCPitstop2.dll" goto NOFILE
  33. echo Copying new PCPitstop2 ActiveX control
  34. copy "%UserProfile%\Desktop\PCPitstop2.dll" "%dpf%\PCPitstop2.new"
  35. :NOFILE
  36.  
  37. :: Switch to the DPF folder to do the work
  38. %systemdrive%
  39. cd "%dpf%"
  40.  
  41. :: Unregister PCPitstop2 ActiveX controls found in DPF and the CONFLICT directories
  42. for /D %%s in ( . conflict.* ) do for %%d in ( %dlls% ) do if exist "%%s\%%d" %rs32% "%%s\%%d" & del "%%s\%%d"
  43.  
  44. :: Delete any leftover registry values that track the files or ActiveX objects; throw away spurious warnings about no key found
  45. for %%d in ( %dlls% ) do reg delete "%LMCV%\ModuleUsage\%SystemRoot:\=/%/Downloaded Program Files/%%d" /F 2>nul:
  46. for /D %%s in ( conflict.* ) do for %%d in ( %dlls% ) do reg delete "%LMCV%\ModuleUsage\%SystemRoot:\=/%/Downloaded Program Files/%%s/%%d" /F 2>nul:
  47. for %%d in ( %dlls% ) do reg delete "%LMCV%\SharedDLLs" /V "%dpf%\%%d" /F 2>nul:
  48. for /D %%s in ( conflict.* ) do for %%d in ( %dlls% ) do reg delete "%LMCV%\SharedDLLs" /V "%dpf%\%%s\%%d" /F 2>nul:
  49. for %%d in ( %dlls% ) do reg delete "HKCR\AppID\%%d" /F 2>nul:
  50. reg delete "HKCR\CLSID\{%cexam%}" /F 2>nul:
  51. reg delete "HKCR\Typelib\{%texam%}" /F 2>nul:
  52. reg delete "HKLM\SOFTWARE\Microsoft\Code Store Database\Distribution Units\{%cexam%}" /F 2>nul:
  53.  
  54. :: Remove the IE kill bits in case they somehow got set (e.g., through IE Tools/Manage Add-Ons)
  55. reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\Settings\{%cexam%}" /F 2>nul:
  56.  
  57. :: Do the same for 64-bit systems; this won't hurt 32-bit since all these keys just don't exist
  58. set LMCV=HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion
  59. for %%d in ( %dlls% ) do reg delete "%LMCV%\ModuleUsage\%SystemRoot:\=/%/Downloaded Program Files/%%d" /F 2>nul:
  60. for /D %%s in ( conflict.* ) do for %%d in ( %dlls% ) do reg delete "%LMCV%\ModuleUsage\%SystemRoot:\=/%/Downloaded Program Files/%%s/%%d" /F 2>nul:
  61. for %%d in ( %dlls% ) do reg delete "%LMCV%\SharedDLLs" /V "%dpf%\%%d" /F 2>nul:
  62. for /D %%s in ( conflict.* ) do for %%d in ( %dlls% ) do reg delete "%LMCV%\SharedDLLs" /V "%dpf%\%%s\%%d" /F 2>nul:
  63. reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Code Store Database\Distribution Units\{%cexam%}" /F 2>nul:
  64.  
  65. :: Clear the IE cache; works for IE7 but generates an entry point dialog error for IE6
  66. rundll32 inetcpl.cpl,ClearMyTracksByProcess 8
  67.  
  68. :: Register the  new dll
  69. if not exist PCPitstop2.new goto NOREGISTER
  70. echo Installing new PCPitstop2 ActiveX control
  71. if exist PCPitstop2.dll del PCPitstop2.dll
  72. ren PCPitstop2.new PCPitstop2.dll
  73. "%systemroot%\system32\regsvr32.exe" PCPitstop2.dll
  74. :NOREGISTER
  75.  
  76.  
  77. echo .
  78. echo . PCPitstop2 ActiveX control removal/update complete.
  79. echo .
  80. echo . If you saw a dialog "Missing entry: ClearMyTracksByProcess" it means the
  81. echo . system is running IE6; please clear your IE cache before continuing.
  82. echo . (In IE6, Tools, Internet Options, General tab, Delete Files.)
  83. echo .
  84. echo . If a new control was not installed at this time, one will be installed
  85. echo . the next time you use a PC Pitstop product or service that requires it.
  86. echo .
  87. pause
  88.  
  89.